package org.zhigong.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.zhigong.dao.YuangongDao;
import org.zhigong.entity.Yuangong;
import org.zhigong.service.YuangongService;

import java.util.List;

@Service
public class YuangongServiceImpl implements YuangongService {

    @Autowired
    private YuangongDao yuangongDao;

    public List<Yuangong> getYuangongList(Yuangong yuangong) {
        return yuangongDao.selectByPage(yuangong);
    }

    public Yuangong getYuangongByYgbh(Long ygbh) {
        return yuangongDao.queryByYgbh(ygbh);
    }

    public Boolean addYuangong(Yuangong yuangong) {
        return yuangongDao.insertYuangong(yuangong) == 1;
    }

    public Boolean updateYuangong(Yuangong yuangong) {
        return yuangongDao.updateYuangong(yuangong) == 1;
    }

    public Boolean deleteYuangong(Long ygbh) {
        return yuangongDao.deleteYuangong(ygbh) == 1;
    }
}
